import { $Http } from '@/config/service/http';

export enum Api {
  // 项目文件目录
  projectBatchDelete = '/dmsfile/projectFileDirectory/batchDelete', // 批量删除
  // projectBatchDownload = '/dmsfile/projectFileDirectory/createBatchDownloadTask', // 批量下载
  projectBatchDownload = '/dmsfile/projectFileDirectory/batchDownload', // 批量下载
  projectCopyFile = '/dmsfile/projectFileDirectory/copyFile', // 复制文件
  projectCreateProjectFolder = '/dmsfile/projectFileDirectory/createProjectFolder', // 创建项目文件夹
  projectDelete = '/dmsfile/projectFileDirectory/delete', // 删除
  // projectDownload = '/dmsfile/projectFileInfo/downloadPartFile', // 单个下载
  projectDownload = '/dmsfile/projectFileDirectory/download', // 单个下载
  projectGet = '/dmsfile/projectFileDirectory/get', // 详情
  projectGetChildrenFolders = '/dmsfile/projectFileDirectory/getChildrenFolders', // 获取子文件夹列表
  projectGetParentFolder = '/dmsfile/projectFileDirectory/getParentFolder', // 得到指定父层级的文件夹
  projectMoveFile = '/dmsfile/projectFileDirectory/moveFile', // 移动文件
  projectPage = '/dmsfile/projectFileDirectory/page', // 分页查询
  projectQueryFolderWithFilePage = '/dmsfile/projectFileDirectory/queryFolderWithFilePage', // 文件夹和文件分页查询
  projectQueryParentFolderFilePage = '/dmsfile/projectFileDirectory/queryParentFolderFilePage', // 得到父亲文件夹下的目录和文件列表分页查询
  projectRename = '/dmsfile/projectFileDirectory/rename', // 重命名
  projectSave = '/dmsfile/projectFileDirectory/save', // 保存
  // 项目文件详情
  fileCopy = '/dmsfile/projectFileInfo/copyFile', // 复制文件
  fileDelete = '/dmsfile/projectFileInfo/delete', // 删除
  fileDownload = '/dmsfile/projectFileInfo/downloadFile/{id}', // 下载文件
  fileDownloadBytes = '/dmsfile/projectFileInfo/downloadFileByBytes/{id}', // 下载文件字节方式
  fileGet = '/dmsfile/projectFileInfo/get', // 详情
  fileGetChildren = '/dmsfile/projectFileInfo/getChildrenFiles', // 得到文件夹下的目录列表下的文件
  fileGetOnlineEditConfig = '/dmsfile/projectFileInfo/getOnlineEditConfig', // 得到在线编辑的配置信息
  fileGetPreviewFileUrl = '/dmsfile/projectFileInfo/getPreviewFileUrl', // 获取文件预览地址
  fileGetPublicVisitFileUrl = '/dmsfile/projectFileInfo/getPublicVisitFileUrl', // 获取文件公共访问地址
  fileList = '/dmsfile/projectFileInfo/list', // 根据ids获取文件详情
  fileMove = '/dmsfile/projectFileInfo/moveFile', // 移动文件
  filePage = '/dmsfile/projectFileInfo/page', // 分页查询
  fileRename = '/dmsfile/projectFileInfo/rename', // 重命名
  fileSave = '/dmsfile/projectFileInfo/save', // 保存
  fileUpload = '/dmsfile/projectFileInfo/uploadFile', // 上传文件
  fileUploadFileByBase64 = '/dmsfile/projectFileInfo/uploadFileByBase64', // 通过Base64字节上传文件
  fileUploadFileByBytes = '/dmsfile/projectFileInfo/uploadFileByBytes', // 通过字节上传文件
  fileUploadFiles = '/dmsfile/projectFileInfo/uploadFiles', // 上传多个文件
  fileView = '/dmsfile/projectFileInfo/viewFile', // 查看文件
  fileOptlist = '/dmsfile/projectFileDirectory/getFileOptList', // 获取文件权限
  // 项目文件版本
  versionDelete = '/dmsfile/projectFileVersion/delete', // 删除
  versionDownload = '/dmsfile/projectFileVersion/download', // 查看文件
  versionGet = '/dmsfile/projectFileVersion/get', // 详情
  versionGetByFileId = '/dmsfile/projectFileVersion/getByFileId', // 得到文件版本列表
  versionGetPreviewFileUrl = '/dmsfile/projectFileVersion/getPreviewFileUrl', // 获取文件预览地址
  versionGetPublicVisitFileUrl = '/dmsfile/projectFileVersion/getPublicVisitFileUrl', // 获取文件公共访问地址
  versionPage = '/dmsfile/projectFileVersion/page', // 分页查询
  versionSave = '/dmsfile/projectFileVersion/save', // 保存
  versionSetAsCurrent = '/dmsfile/projectFileVersion/setAsCurrent', // 设置当前版本为最新版本
  versionViewFile = '/dmsfile/projectFileVersion/viewFile', // 查看文件
  // 项目文件任务记录
  recordDelete = '/dmsfile/projectFileTaskRecord/delete', // 删除
  recordGet = '/dmsfile/projectFileTaskRecord/get', // 详情
  recordPage = '/dmsfile/projectFileTaskRecord/page', // 分页查询
  recordSave = '/dmsfile/projectFileTaskRecord/save' // 保存
}

export const projectBatchDelete = (params) => {
  return $Http.api(Api.projectBatchDelete, params, 'post');
};

export const fileGetPreviewFileUrl = (params) => {
  return $Http.api(Api.fileGetPreviewFileUrl, params, 'post');
};

export const projectCreateProjectFolder = (params) => {
  return $Http.api(Api.projectCreateProjectFolder, params, 'post');
};

export const projectGet = (id) => {
  return $Http.api(Api.projectGet, id, 'get');
};

export const projectGetChildrenFolders = (params) => {
  return $Http.api(Api.projectGetChildrenFolders, params, 'post');
};

export const projectSave = (params) => {
  return $Http.api(Api.projectSave, params, 'post');
};

export const fileOptlist = (params) => {
  return $Http.api(Api.fileOptlist, params, 'post');
};

export const setAsCurrent = (params) => {
  return $Http.api(Api.versionSetAsCurrent, params, 'post');
};
